package com.hhp.cloud.shop.common.core.enums;

/**
 * @Description: 自定义返回码
 * @author: hhp
 * @date: 2021/11/18 16:19
 */
public enum BizCodeEnume {
    SUCCESS(0,"success"),

    //10:通用 || gateway
    UNKNOW_EXCEPTION(100000,"系统未知异常"),
    VAILD_EXCEPTION(100001,"参数格式校验失败"),
    SMS_CODE_EXCEPTION(100002,"验证码获取频率太高,请稍后再试"),
    TOO_MANY_REQUEST(100003,"请求频率太高,请稍后再试"),
    PARAM_ERROR(100004,"请求参数错误"),
    RESOURCE_NOT_FOUND(100005, "请求资源不存在"),
    PARAM_IS_NULL(100006, "请求必填参数为空"),
    SMS_SEND_EXCEPTION(100007, "验证码发送失败"),
    FORBIDDEN_OPERATION(100008, "演示环境禁止修改、删除重要数据，请本地部署后测试"),
    FLOW_LIMITING(100009, "系统限流"),
    DEGRADATION(100010, "系统功能降级"),

    //11:认证 auth
    CLIENT_AUTHENTICATION_FAILED(110000, "客户端认证失败"),
    ACCESS_UNAUTHORIZED(110001, "访问未授权"),
    TOKEN_INVALID_OR_EXPIRED(110002, "token无效或已过期"),
    TOKEN_ACCESS_FORBIDDEN(110003, "token已被禁止访问"),

    //12:用户 admin
    USERNAME_OR_PASSWORD_ERROR(120000, "用户名或密码错误"),
    USER_EXIST_EXCEPTION(120001,"用户已存在"),
    PHONE_EXIST_EXCEPTION(120002,"用户不存在"),
    USER_NOT_EXIST(120003,"手机号已存在"),
    LOGINACCT_PASSWORD_INVALID_EXCEPTION(120004,"账号或密码错误"),

    //13:会员 member

    //14:产品 product
    PRODUCT_UP_EXCEPTION(140000,"商品上架异常"),

    //15:订单 order


    NO_STOCK_EXCEPTION(210000,"商品库存不足");

    private int code;
    private String msg;
    BizCodeEnume(int code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
